<%--                                                                       --%>
<%-- Copyright (c) 2005 BroadVision, Inc.  All rights reserved.            --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>


<%@ page import =  "java.util.HashMap,
                    org.apache.commons.beanutils.PropertyUtils,
                    org.apache.struts.validator.DynaValidatorForm"
%>

<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>



<script language="javascript" src="<%=request.getContextPath()%>/mt/js/userPopup.js"></script>

<script language="JavaScript">

<%@ include file="/mc/common/jsutils.jsp" %>

  var isNav = (navigator.appName.indexOf("Netscape") != -1);
  var isIE = (navigator.appName.indexOf("Microsoft") != -1);

  function findField(theForm, fieldName) {
    var elements = theForm.elements;
    var numElements = elements.length;
    for (var elementIndex = 0; elementIndex < numElements; elementIndex++) {
      var elementName = elements[elementIndex].name;
      if (elementName == fieldName) {
        return elements[elementIndex];
      }
    }
    return null;
  }

  function gotoFirstPage(formName) {
    if (doValidateEntriesPerPage(formName) == false) {
      return false;
    }
    var thisForm = document.forms[formName];
    if (thisForm != null) {
      thisForm.currentPageNumber.value = 1;
      thisForm.submit();
      return false;
    }
  }

  function gotoPreviousPage(formName) {
    if (doValidateEntriesPerPage(formName) == false) {
      return false;
    }
    var thisForm = document.forms[formName];
    if (thisForm != null) {
      var currentPageNumber = thisForm.currentPageNumber.value;
      currentPageNumber--;
      if (thisForm.entriesPerPage.value != <c:out value="${mtGroupForm.map.entriesPerPage}"/>) {
        currentPageNumber = 1;
      }
      if (currentPageNumber > 0) {
        thisForm.currentPageNumber.value = currentPageNumber;
        thisForm.submit();
      }
    }
  }

  function gotoNextPage(formName) {
    if (doValidateEntriesPerPage(formName) == false) {
      return false;
    }
    var thisForm = document.forms[formName];
    if (thisForm != null) {
      var currentPageNumber = thisForm.currentPageNumber.value;
      currentPageNumber++;
      if (thisForm.entriesPerPage.value != <c:out value="${mtGroupForm.map.entriesPerPage}"/>) {
        currentPageNumber = 1;
      }
      if (currentPageNumber <= thisForm.totalPageNumber.value) {
        thisForm.currentPageNumber.value = currentPageNumber;
        thisForm.submit();
      }
    }
  }

  function gotoLastPage(formName) {
    if (doValidateEntriesPerPage(formName) == false) {
      return false;
    }
    var thisForm = document.forms[formName];
    if (thisForm != null) {
      if (thisForm.entriesPerPage.value != <c:out value="${mtGroupForm.map.entriesPerPage}"/>) {
        thisForm.currentPageNumber.value = 1;
      }
      else {
        thisForm.currentPageNumber.value = thisForm.totalPageNumber.value;
      }
      thisForm.submit();
    }
  }


  function doGo(formName) {
    var thisForm = document.forms[formName];
    if (thisForm != null) {
      if (thisForm.entriesPerPage.value != <c:out value="${mtGroupForm.map.entriesPerPage}"/>) {
        thisForm.currentPageNumber.value = 1;
        thisForm.submit();
      }
    }
    return false;
  }

  function checkNumberOnly(e) {
    var charCode = (navigator.appName == "Netscape") ? e.which : e.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
      return false;
    }
    else {
      return true;
    }
  }

  function doValidateEntriesPerPage(formName) {
    var thisForm = document.forms[formName];
    if (thisForm != null) {
      if (thisForm.entriesPerPage == null) {
        return true;
      }
      var entriesPerPageInt = parseInt(thisForm.entriesPerPage.value);

      if (isNaN(entriesPerPageInt)) {
        alert("<bean-el:message key="mt.common.pagination.validation.itemsPerPage" bundle="mt.messages"/>");
        thisForm.entriesPerPage.select();
        thisForm.entriesPerPage.focus();
        return false;
      }
      if (thisForm.entriesPerPage.value < 1 || thisForm.entriesPerPage.value > 2147483647) {
        alert("<bean-el:message key="mt.common.pagination.validation.itemsPerPage" bundle="mt.messages"/>");
        thisForm.entriesPerPage.select();
        thisForm.entriesPerPage.focus();
        return false;
      }
      else {
        return true;
      }
    }
    return false;
  }

  function doOneGroupMoveAction(theForm, fqn) {
      theForm.subGroupFQN.value=fqn;
      theForm.oneOnly.value = true;
      theForm.action = '<html-el:rewrite page="/mt/groupMove.do" />';
      theForm.submit();
      return true;
  }

  function doGroupMoveAction(theForm) {
      theForm.oneOnly.value = false;
      theForm.action = '<html-el:rewrite page="/mt/groupMove.do" />';
      theForm.submit();
      return true;
  }

  function doOneGroupDeleteAction(theForm, i) {
    var deleteMessage = '<bean-el:message key="mt.group.confirm.delete" bundle="mt.messages"/>';
    if (confirm(deleteMessage)) {
      var fieldName = 'oneGroup[' + i + '].fqn';
      var field = findField(theForm, fieldName);
      theForm.subGroupFQN.value=field.value;
      theForm.oneOnly.value = true;
      theForm.action = '<html-el:rewrite page="/mt/groupDelete.do" />';
      theForm.submit();
      return true;
    }
    else {
      return false;
    }
  }

  function doGroupDeleteAction(theForm) {
    var deleteMessage = '<bean-el:message key="mt.group.confirm.delete" bundle="mt.messages"/>';
    if (confirm(deleteMessage)) {
      theForm.oneOnly.value = false;
      theForm.action = '<html-el:rewrite page="/mt/groupDelete.do" />';
      theForm.submit();
      return true;
    }
    else {
      return false;
    }
  }

  function doOneGroupMemberDeleteAction(theForm, userId) {
    var deleteMessage = '<bean-el:message key="mt.group.member.confirm.delete" bundle="mt.messages"/>';
//    if (confirm(deleteMessage)) {
      theForm.oneGroupMember.value=userId;
      theForm.oneMemberOnly.value = true;
      theForm.action = '<html-el:rewrite page="/mt/groupMemberDelete.do" />';
      theForm.submit();
      return true;
//    }
//    else {
//      return false;
//    }
  }

  function doGroupMemberDeleteAction(theForm) {
    var deleteMessage = '<bean-el:message key="mt.group.member.confirm.delete" bundle="mt.messages"/>';
//    if (confirm(deleteMessage)) {
      theForm.oneMemberOnly.value = false;
      theForm.action = '<html-el:rewrite page="/mt/groupMemberDelete.do" />';
      theForm.submit();
      return true;
//    }
//    else {
//      return false;
//    }
  }

  function doGroupNewAction(theForm) {
    theForm.action = '<html-el:rewrite page="/mt/groupNew.do" />';
    theForm.submit();
    return true;
  }

  function doGroupEditAction(theForm, i) {
    var fieldName = 'oneGroup[' + i + '].fqn';
    var field = findField(theForm, fieldName);
    theForm.parentGroupFQN.value=theForm.groupFQN.value;
    theForm.groupFQN.value=field.value;
    theForm.action = '<html-el:rewrite page="/mt/groupEdit.do" />';
    theForm.submit();
    return true;
  }

  function doGroupViewAction(theForm, i) {
    var fieldName = 'oneGroup[' + i + '].fqn';
    var field = findField(theForm, fieldName);
    theForm.groupFQN.value=field.value;
    theForm.action = '<html-el:rewrite page="/mt/groupView.do" />';
    theForm.method = "post";
    theForm.submit();
    return true;
  }


function doBCAction(theForm, name, property, index) {
    var fieldName = name + '[' + index + '].' + property;
    var field = findField(theForm, fieldName);
    theForm.groupFQN.value = field.value;
    theForm.action = '<html-el:rewrite page="/mt/groupView.do" />';
    theForm.submit();
    return true;
  }

//
// 'callback' function to the parentWindow to set the user aliases (for multiple selections)
//

function setSelectedUsers(formName, fieldName, users) {
    var thisForm = document.forms[formName];
    var elements = thisForm.elements;
    var numElements = elements.length;
    var field = null;
    for (var elementIndex = 0; elementIndex < numElements; elementIndex++) {
      var elementName = elements[elementIndex].name;
      if (elementName == fieldName) {
        field = elements[elementIndex];
        break;
      }
    }
    if (field != null) {
      if (users != null) {
        var numUsers = users.length;
        if (0 == numUsers) {
          return;
        }
        var i = 0;
        field.length = 0;
        for (i = 0; i < numUsers; i++) {
          var newoption = new Option(users[i], users[i], true, true);
          field.options[i] = newoption;
        }
      }
      else {
	return;
      }
    }
    thisForm.action='<html-el:rewrite page="/mt/groupMemberAdd.do"/>';
    thisForm.submit();
  }

function onClickGroupBrowseTab() {
	  var  theForm = document.forms['mtGroupForm'];
	      theForm.action = '<html-el:rewrite page="/mt/groupView.do" />';
  	      theForm.submit();
      return false;
    }

 function onClickGroupSearchTab() {
      var  theForm = document.forms['mtGroupForm'];
		  	 theForm.action = '<html-el:rewrite page="/mt/groupSearch.do" />';
	    	 theForm.submit();
      return false;
  }



</script>

<%
  java.util.HashMap map = new java.util.HashMap();
  DynaValidatorForm mtGroupForm = (DynaValidatorForm) request.getAttribute("mtGroupForm");
  map.put("groupFQN",(String) PropertyUtils.getSimpleProperty(mtGroupForm, "groupFQN"));
  pageContext.setAttribute("pagetabParam", map, PageContext.PAGE_SCOPE);
   %>

<c:set var="editImg">
<img src="<%= request.getContextPath() %>/mc/images/action/icon_edit.gif" width="15" height="15" border="0" class="actionIcon" alt="<bean-el:message key="image.alt.edit" bundle="mt.messages"/>" title="<bean-el:message key="image.alt.edit" bundle="mt.messages"/>">
</c:set>

<c:set var="removeImg">
<img src="<%= request.getContextPath() %>/mc/images/action/icon_remove.gif" width="15" height="15" border="0" class="actionIcon" alt="<bean-el:message key="image.alt.remove" bundle="mt.messages"/>" title="<bean-el:message key="image.alt.remove" bundle="mt.messages"/>">
</c:set>

<c:set var="deleteImg">
<img src="<%= request.getContextPath() %>/mc/images/action/icon_delete.gif" width="15" height="15" border="0" class="actionIcon" alt="<bean-el:message key="image.alt.delete" bundle="mt.messages"/>" title="<bean-el:message key="image.alt.delete" bundle="mt.messages"/>">
</c:set>


<html-el:form action="/mt/groupView.do">

<html-el:hidden property="groupFQN"/>
<html-el:hidden property="currentPageNumber"/>
<html-el:hidden property="totalPageNumber"/>
<html-el:hidden property="oneOnly"/>
<html-el:hidden property="oneMemberOnly"/>
<html-el:hidden property="oneGroupMember"/>
<html-el:hidden property="subGroupFQN"/>
<input type="hidden" name="parentGroupFQN" value=""/>

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">

        <div class="pageTitle">
            <bean-el:message key="mt.group.browse.title" bundle="mt.messages"/>:
            <c:out value="${mtGroupView.map.groupName}"/>
        </div>

	<div class="errorMessage"><html-el:errors bundle="mt.messages"/></div>
        <%@include file="/mc/common/pagetab.jsp" %>

      <!-- end of PageTab -->

        <div class="breadcrumb">
          <c:if test="${not empty mtGroupView.map.breadcrumbs}">
            <c:if test="${mtGroupForm.map.groupFQN != 'root'}">
              <c:forEach var="oneBC" items="${mtGroupView.map.breadcrumbs}" varStatus="status">
                <c:choose>
                  <c:when test="${not empty oneBC.map.fqn}">
                    <html-el:hidden name="oneBC" property="fqn" indexed='true'/>
                     <a href="#" onclick="javascript: doBCAction(document.mtGroupForm, 'oneBC', 'fqn',
                      '<c:out value="${status.count - 1}" />');" ><c:out value="${oneBC.map.name}"/></a>
                  </c:when>
                  <c:otherwise>
                    <c:out value="${oneBC.map.name}"/>
                  </c:otherwise>
                </c:choose>
                <c:if test="${not empty oneBC.map.name}">
                  &nbsp;<bean-el:message key="mt.breadcrumb.separator" bundle="mt.messages"/>
                </c:if>
              </c:forEach>
            </c:if>
          </c:if>
          <c:out value="${mtGroupView.map.groupName}" />
        </div>

        <div class="pageSubtitle">
          <span class="left">
            <bean-el:message key="mt.group.groups" bundle="mt.messages"/>&nbsp;
          </span>
          <span class="right">
            <c:if test="${mtGroupForm.map.groupFQN != 'root'}">
              <html-el:submit styleClass="inputButton" property="editBtn"  onclick="return doGroupNewAction(this.form)">
                <bean-el:message key="button.createNewGroup" bundle="mt.messages"/>
              </html-el:submit>
            </c:if>
          </span>
        </div>

      <c:if test="${(not empty mtGroupView.map.groupList) && (mtGroupForm.map.groupFQN != 'root')}">
        <div class="globalButtonWrap">
          <input type="button" name="selectAllGroups" class="globalButton" onclick="check(this.form.groupFQNs, this);" value='<bean-el:message key="button.selectAll" bundle="mt.messages"/>'>
          <input type="button" name="deleteGroup" class="globalButton" onclick="if (isAnyChecked(this.form.groupFQNs, '<bean-el:message key="mt.group.alert.atLeastOneGroup" bundle="mt.messages"/>', '')) doGroupDeleteAction(this.form);" value='<bean-el:message key="button.delete" bundle="mt.messages"/>'>
        </div>
      </c:if>

      <!--start main content area here-->

      <table class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="Category" width="100%">
        <tr class="listHeader">
          <c:if test="${mtGroupForm.map.groupFQN != 'root'}">
            <th id="Checkboxes" align="center" width="5%"></th>
          </c:if>
          <th id="SubCategoryName" align="left" width="40%">
            <bean-el:message key="mt.group.label.groupName" bundle="mt.messages"/>
          </th>
            <th id="SubCategoryAdmin" align="left" width="40%">
              <bean-el:message key="mt.group.label.administrators" bundle="mt.messages"/>
            </th>
            <th id="Actions" align="left"  width="15%" nowrap>
              <bean-el:message key="mt.header.actions" bundle="mt.messages"/>
            </th>
        </tr>

        <c:choose>
          <c:when test="${not empty mtGroupView.map.groupList}">
            <c:forEach var="oneGroup" items="${mtGroupView.map.groupList}" varStatus="status">
              <html-el:hidden name="oneGroup" property="fqn" indexed="true"/>
              <c:choose>
                <c:when test="${(status.count + 1) % 2 == 0}">
	<tr class="listEven">
                </c:when>
  	        <c:otherwise>
	<tr class="listOdd">
	        </c:otherwise>
              </c:choose>

          <c:if test="${mtGroupForm.map.groupFQN != 'root'}">
            <td headers="Checkboxes" align="center">
              <input type="checkbox" name="groupFQNs" onclick="update(this.form.groupFQNs, this.form.selectAllGroups);" value='<c:out value="${oneGroup.map.fqn}"/>'/>
            </td>
          </c:if>
          <td headers="SubCategoryName" align="left" width="40%">
              <a href='#' onclick="JavaScript:doGroupViewAction(document.mtGroupForm, <c:out value="${status.count - 1}"/>);">
                <c:out value="${oneGroup.map.name}"/></a>
            &nbsp;
          </td>
            <td headers="SubCategoryAdmin" align="left" width="40%">
              <c:out value="${oneGroup.map.admins}"/>
            </td>
            <td nowrap align="left" headers="Actions">
              <a href='#' onclick="JavaScript:doGroupEditAction(document.mtGroupForm, <c:out value="${status.count - 1}"/>);">
                <c:out value='${editImg}' escapeXml="false"/></a>
            <c:if test="${mtGroupForm.map.groupFQN != 'root'}">
              <a href='#' onclick="JavaScript:doOneGroupDeleteAction(document.mtGroupForm, <c:out value="${status.count - 1}"/>);">
                <c:out value='${deleteImg}' escapeXml="false"/></a>
           </c:if>
            </td>
        </tr>

            </c:forEach>
          </c:when>
          <c:otherwise>
              <tr class="listOdd">
                <td colspan=7 align="center">
                  <bean-el:message key="mt.group.noGroup" bundle="mt.messages"/>
                </td>
              </tr>
          </c:otherwise>
        </c:choose>
      </table>

      <!--end main content area here-->


    <c:if test="${mtGroupForm.map.groupFQN != 'root'}">
      <br>

      <div class="pageSubtitle">
        <span class="left">
          <bean-el:message key="mt.group.members"  bundle="mt.messages"/>
        </span>
        <span class="right">
          <input type="button" name="addMember" class="pageButton" value='<bean-el:message key="mt.group.members.add" bundle="mt.messages"/>' onclick="JavaScript:userMultiSearchPopup('<html-el:rewrite page="/mt/userMultiSearchPopup.do"/>', 'mtGroupForm','groupMembersToAdd')" >
        </span>

      </div>

      <select name="groupMembersToAdd" multiple="multiple" size="0" style="visibility: hidden; display: none;"></select>

      <c:if test="${not empty mtGroupView.map.memberList}">

        <div class="globalButtonWrap">
          <input type="button" name="selectAllMembers" class="globalButton" onclick="check(this.form.groupMembers, this);" value='<bean-el:message key="button.selectAll" bundle="mt.messages"/>'>
          <input type="button" name="deleteUser" class="globalButton" onclick="if (isAnyChecked(this.form.groupMembers, '<bean-el:message key="mt.group.alert.atLeastOneUser" bundle="mt.messages"/>', '')) doGroupMemberDeleteAction(this.form);" value='<bean-el:message key="button.remove" bundle="mt.messages"/>'>
        </div>
      </c:if>


      <table class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="Search result table" width="100%">
        <tr class="listHeader">
          <th id="Checkboxes" align="center" width="5%"></th>
          <th id="Name" align="left"><bean-el:message key="mt.group.members.header.name"  bundle="mt.messages"/></th>
          <th id="LoginId" align="left"><bean-el:message key="mt.group.members.header.signinID"  bundle="mt.messages"/></th>
          <th id="City" align="left"><bean-el:message key="mt.group.members.header.city"  bundle="mt.messages"/></th>
          <th id="State" align="left"><bean-el:message key="mt.group.members.header.state"  bundle="mt.messages"/></th>
          <th id="Phone" align="left"><bean-el:message key="mt.group.members.header.phone"  bundle="mt.messages"/></th>
          <th id="Email" align="left"><bean-el:message key="mt.group.members.header.email"  bundle="mt.messages"/></th>
          <th id="Actions" align="left" nowrap><bean-el:message key="mt.header.actions"  bundle="mt.messages"/></th>
        </tr>


        <c:choose>
          <c:when test="${not empty mtGroupView.map.memberList}">
            <c:forEach var="oneMember" items="${mtGroupView.map.memberList}" varStatus="status">

              <c:choose>
                <c:when test="${(status.count + 1) % 2 == 0}">
	<tr class="listEven">
                </c:when>
  	        <c:otherwise>
	<tr class="listOdd">
	        </c:otherwise>
              </c:choose>

          <td id="Checkboxes" align="center" width="5%">
             <input type="checkbox" name="groupMembers" onclick="update(this.form.groupMembers, this.form.selectAllMembers);" value='<c:out value="${oneMember.map.userAlias}"/>'/>
          </td>
          <td id="Name" align="left">
            <c:url var="viewUserUrl" value="/mt/userView.do">
              <c:param name="userId" value="${oneMember.map.userId}"/>
            </c:url>
            <a href='<c:out value="${viewUserUrl}"/>'>
              <c:out value="${oneMember.map.name}" />
            </a>
          </td>
          <td id="LoginId" align="left">
            <c:out value="${oneMember.map.userAlias}" />
          </td>
          <td id="City" align="left">
            <c:out value="${oneMember.map.city}" />
          </td>
          <td id="State" align="left">
            <c:out value="${oneMember.map.state}" />
          </td>
          <td id="Phone" align="left">
            <c:out value="${oneMember.map.phone}" />
          </td>
          <td id="Email" align="left">
            <a href="mailto:<c:out value='${oneMember.map.email}'/>">
              <c:out value="${oneMember.map.email}"/>
            </a>
          </td>
          <td id="Actions" align="left" nowrap>
            <a href='#' onclick="JavaScript:doOneGroupMemberDeleteAction(document.mtGroupForm, '<c:out value="${oneMember.map.userAlias}"/>');">
              <c:out value='${removeImg}' escapeXml="false"/></a>
          </td>
        </tr>

            </c:forEach>
          </c:when>
          <c:otherwise>
              <tr class="listOdd">
                <td colspan=9 align="center">
                  <bean-el:message key="mt.group.noMember" bundle="mt.messages"/>
                </td>
              </tr>
          </c:otherwise>
        </c:choose>
      </table>

      <c:if test="${not empty mtGroupView.map.memberList}">
        <div class="pagination">

          <bean-el:message key="page.show" bundle="mt.messages"/>
          <html-el:select property="entriesPerPage" size="1"  onchange="javascript:doGo('mtGroupForm')">
            <html-el:option value="10"><bean-el:message key="pager.option1" bundle="mt.messages"/></html-el:option>
            <html-el:option value="20"><bean-el:message key="pager.option2" bundle="mt.messages"/></html-el:option>
            <html-el:option value="30"><bean-el:message key="pager.option3" bundle="mt.messages"/></html-el:option>
            <html-el:option value="50"><bean-el:message key="pager.option4" bundle="mt.messages"/></html-el:option>
            <html-el:option value="100"><bean-el:message key="pager.option5" bundle="mt.messages"/></html-el:option>
          </html-el:select>
          <bean-el:message key="page.itemsPerPage" bundle="mt.messages"/>
          &nbsp;&nbsp;

          <c:if test="${mtGroupForm.map.totalPageNumber > 1}">
            &nbsp;&nbsp;&nbsp;
            <c:if test="${mtGroupForm.map.currentPageNumber > 0}">
              <c:if test="${mtGroupForm.map.totalPageNumber > 1}">
                <c:if test="${mtGroupForm.map.currentPageNumber > 1}">
                  <a href="#" class="paginationBtn" onclick="javascript:gotoFirstPage('mtGroupForm')">
                    <bean-el:message key="page.first" bundle="mt.messages"/></a>
                  <a href="#" class="paginationBtn" onclick="javascript:gotoPreviousPage('mtGroupForm')">
                    <bean-el:message key="page.previous" bundle="mt.messages"/></a>
                </c:if>
              </c:if>
              <c:set var="currentPageNumberAttr" scope="page" value="${mtGroupForm.map.currentPageNumber}"/>
              <c:set var="totalPageNumberAttr" scope="page" value="${mtGroupForm.map.totalPageNumber}"/>
              <% Integer currentPageNumberInt = (Integer)pageContext.getAttribute("currentPageNumberAttr"); %>
              <% Integer totalPageNumberInt = (Integer)pageContext.getAttribute("totalPageNumberAttr"); %>
              <bean-el:message key="page.pageOf"
                arg0="<%= currentPageNumberInt.toString() %>"
                arg1="<%= totalPageNumberInt.toString() %>" bundle="mt.messages"/>
              <c:if test="${mtGroupForm.map.totalPageNumber > 1}">
                <c:if test="${mtGroupForm.map.currentPageNumber < mtGroupForm.map.totalPageNumber}">
                  <a href="#" class="paginationBtn" onclick="javascript:gotoNextPage('mtGroupForm')">
                    <bean-el:message key="page.next" bundle="mt.messages"/></a>
                  <a href="#" class="paginationBtn" onclick="javascript:gotoLastPage('mtGroupForm')">
                    <bean-el:message key="page.last" bundle="mt.messages"/></a>
                </c:if>
              </c:if>
            </c:if>
          </c:if>
        </div>
      </c:if>
    </c:if>
    </td>
  </tr>
</table>

</html-el:form>

